import request from '@/utils/request'

export function listRole(pos, size, conditions) {
  return request({
    url: '/role/list',
    params: {
      'jsonCondition': JSON.stringify(conditions),
      'pos': pos,
      'size': size
    },
    method: 'get'
  })
}
export function setRole(rolemodel, roledetail) {
  return request({
    url: '/role/set',
    data: {
      main: JSON.stringify(rolemodel),
      detail: JSON.stringify(roledetail)
    },
    method: 'post'
  })
}

export function delRole(rolemodel) {
  return request({
    url: '/role/del',
    data: rolemodel,
    method: 'post'
  })
}
export function delRoles(jsonrolemodel) {
  return request({
    url: '/role/bulkdel',
    data: {
      data: jsonrolemodel
    }, // contentType 要求接受JSON格式
    method: 'post'
  })
}
export function get(id) {
  return request({
    url: '/role/get',
    params: {
      'id': id
    },
    method: 'get'
  })
}
